home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / SCSI.p < prev    next >
Encoding:
Text File  |  1991-04-03  |  4.6 KB  |  133 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {
  4. Created: Sunday, January 6, 1991 at 11:14 PM
  5.     SCSI.p
  6.     Pascal Interface to the Macintosh Libraries
  7.  
  8.         Copyright Apple Computer, Inc.    1986-1990
  9.         All rights reserved
  10. }
  11.  
  12.  
  13. {$IFC UNDEFINED UsingIncludes}
  14. {$SETC UsingIncludes := 0}
  15. {$ENDC}
  16.  
  17.  
  18.     UNIT SCSI;
  19.     INTERFACE USES    Types;
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33. CONST
  34. scInc = 1;
  35. scNoInc = 2;
  36. scAdd = 3;
  37. scMove = 4;
  38. scLoop = 5;
  39. scNop = 6;
  40. scStop = 7;
  41. scComp = 8;
  42. scCommErr = 2;                                  {communications error, operation timeout}
  43. scArbNBErr = 3;                                 {arbitration timeout waiting for not BSY}
  44. scBadParmsErr = 4;                              {bad parameter or TIB opcode}
  45. scPhaseErr = 5;                                 {SCSI bus not in correct phase for attempted operation}
  46. scCompareErr = 6;                               {data compare error}
  47. scMgrBusyErr = 7;                               {SCSI Manager busy }
  48. scSequenceErr = 8;                              {attempted operation is out of sequence}
  49. scBusTOErr = 9;                                 {CPU bus timeout}
  50. scComplPhaseErr = 10;                           {SCSI bus wasn't in Status phase}
  51. sbSIGWord = $4552;
  52. pMapSIG = $504D;
  53.  
  54. TYPE
  55. Block0 = PACKED RECORD
  56.     sbSig: INTEGER;                             {unique value for SCSI block 0}
  57.     sbBlkSize: INTEGER;                         {block size of device}
  58.     sbBlkCount: LONGINT;                        {number of blocks on device}
  59.     sbDevType: INTEGER;                         {device type}
  60.     sbDevId: INTEGER;                           {device id}
  61.     sbData: LONGINT;                            {not used}
  62.     sbDrvrCount: INTEGER;                       {driver descriptor count}
  63.     ddBlock: LONGINT;                           {1st driver's starting block}
  64.     ddSize: INTEGER;                            {size of 1st driver (512-byte blks)}
  65.     ddType: INTEGER;                            {system type (1 for Mac+)}
  66.     ddPad: ARRAY [0..242] OF INTEGER;           {ARRAY[0..242] OF INTEGER; not used}
  67.     END;
  68.  
  69. Partition = PACKED RECORD
  70.     pmSig: INTEGER;                             {unique value for map entry blk}
  71.     pmSigPad: INTEGER;                          {currently unused}
  72.     pmMapBlkCnt: LONGINT;                       {# of blks in partition map}
  73.     pmPyPartStart: LONGINT;                     {physical start blk of partition}
  74.     pmPartBlkCnt: LONGINT;                      {# of blks in this partition}
  75.     pmPartName: PACKED ARRAY [0..31] OF CHAR;   {ASCII partition name}
  76.     pmParType: PACKED ARRAY [0..31] OF CHAR;    {ASCII partition type}
  77.     pmLgDataStart: LONGINT;                     {log. # of partition's 1st data blk}
  78.     pmDataCnt: LONGINT;                         {# of blks in partition's data area}
  79.     pmPartStatus: LONGINT;                      {bit field for partition status}
  80.     pmLgBootStart: LONGINT;                     {log. blk of partition's boot code}
  81.     pmBootSize: LONGINT;                        {number of bytes in boot code}
  82.     pmBootAddr: LONGINT;                        {memory load address of boot code}
  83.     pmBootAddr2: LONGINT;                       {currently unused}
  84.     pmBootEntry: LONGINT;                       {entry point of boot code}
  85.     pmBootEntry2: LONGINT;                      {currently unused}
  86.     pmBootCksum: LONGINT;                       {checksum of boot code}
  87.     pmProcessor: PACKED ARRAY [0..15] OF CHAR;  {ASCII for the processor type}
  88.     pmPad: ARRAY [0..187] OF INTEGER;           {512 bytes long currently unused}
  89.     END;
  90.  
  91. SCSIInstr = RECORD
  92.     scOpcode: INTEGER;
  93.     scParam1: LONGINT;
  94.     scParam2: LONGINT;
  95.     END;
  96.  
  97.  
  98. FUNCTION SCSIReset: OSErr;
  99.     INLINE $4267,$A815;
  100. FUNCTION SCSIGet: OSErr;
  101.     INLINE $3F3C,$0001,$A815;
  102. FUNCTION SCSISelect(targetID: INTEGER): OSErr;
  103.     INLINE $3F3C,$0002,$A815;
  104. FUNCTION SCSICmd(buffer: Ptr;count: INTEGER): OSErr;
  105.     INLINE $3F3C,$0003,$A815;
  106. FUNCTION SCSIRead(tibPtr: Ptr): OSErr;
  107.     INLINE $3F3C,$0005,$A815;
  108. FUNCTION SCSIRBlind(tibPtr: Ptr): OSErr;
  109.     INLINE $3F3C,$0008,$A815;
  110. FUNCTION SCSIWrite(tibPtr: Ptr): OSErr;
  111.     INLINE $3F3C,$0006,$A815;
  112. FUNCTION SCSIWBlind(tibPtr: Ptr): OSErr;
  113.     INLINE $3F3C,$0009,$A815;
  114. FUNCTION SCSIComplete(VAR stat: INTEGER;VAR message: INTEGER;wait: LONGINT): OSErr;
  115.     INLINE $3F3C,$0004,$A815;
  116. FUNCTION SCSIStat: INTEGER;
  117.     INLINE $3F3C,$000A,$A815;
  118. FUNCTION SCSISelAtn(targetID: INTEGER): OSErr;
  119.     INLINE $3F3C,$000B,$A815;
  120. FUNCTION SCSIMsgIn(VAR message: INTEGER): OSErr;
  121.     INLINE $3F3C,$000C,$A815;
  122. FUNCTION SCSIMsgOut(message: INTEGER): OSErr;
  123.     INLINE $3F3C,$000D,$A815;
  124.  
  125.  
  126.     { UsingSCSI }
  127.  
  128.  
  129.     IMPLEMENTATION
  130. END.
  131.  
  132.  
  133.